package br.pucminas.virtual.validator.view;

import br.pucminas.virtual.validator.Validator;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.EditText;

public class CpfEditText extends EditText{

	public CpfEditText(Context context) {
		super(context);
	}

	public CpfEditText(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}

	public CpfEditText(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	@Override
	protected void onFocusChanged(boolean focused, int direction,
			Rect previouslyFocusedRect) {
		super.onFocusChanged(focused, direction, previouslyFocusedRect);
		Log.e("Cuestom EditText", "focused = " + focused + " direction = " + direction);
		if (!focused) {
			Validator.validateCpf(this, "cpf invalido");
		}
		
		
	}

	
	
}
